#pragma once

#include "boost\bind.hpp"
#include "boost\asio.hpp"
#include "boost\thread.hpp"
#include "boost\lexical_cast.hpp"
#include "define.h"

using namespace boost;
using namespace std;
using namespace boost::asio;
class CServerSession
{
public:
	CServerSession(asio::io_service& io_service);
	~CServerSession();

	ip::tcp::socket& socket()
	{
		return m_socket;
	}

	void start();

	void handle_read(const system::error_code& error, size_t transferred);

	void handle_write(const system::error_code& error);

private:
	ip::tcp::socket					m_socket;
	char							m_data[MAX_PACKET_LEN];
	int								m_recv_times;
};

